// EditStep.h: interface for the CEditStep class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_EDITSTEP_H__74B1627D_7067_4281_B61E_A61A453254C2__INCLUDED_)
#define AFX_EDITSTEP_H__74B1627D_7067_4281_B61E_A61A453254C2__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//class CAnsiPage;
//#include "AnsiPage.h"

class CEditStep  
{
public:
	void Compact();
	CRect GetAffectedRect();
	BOOL IsEmpty();
	void AddCells(CRect &rect)
	{
		AddCells(rect.left, rect.top, rect.right, rect.bottom);
	}
	void AddCells(int x1, int y1, int x2, int y2);
	void AddCell(CPoint &pt)
	{
		AddCell(pt.x, pt.y);
	}
	void AddCell(int x, int y)
	{
		CellData celldata;
		
		celldata.pt.x = x;
		celldata.pt.y = y;
		celldata.c = m_pPage->m_chars[y][x];
		celldata.cell = m_pPage->m_cells[y][x];
		
		m_arrCellData.Add(celldata);
	}
	typedef struct CellData
	{
		CPoint pt;
		CCellInfo cell;
		char c;
	} CellData;

	CAnsiPage* m_pPage;
	void Restore();
	void SaveCursorPos(int x, int y);
	CEditStep(CAnsiPage *pAnsiPage);
	~CEditStep();

protected:
	CArray< CellData, CellData > m_arrCellData;
	CPoint m_ptCursor;
};

#endif // !defined(AFX_EDITSTEP_H__74B1627D_7067_4281_B61E_A61A453254C2__INCLUDED_)
